1. Field of the Invention
This invention relates generally to computer I/O subsystems having expanders, and more particularly to methods for automatically assigning addresses to expanders in I/O subsystems over peripheral buses.
2. Description of the Related Art
Modern computer systems often utilize one or more buses to connect to peripheral devices to enhance its resources. For example, the resources of a computer system may be substantially increased by connecting the computer system to one or more peripheral devices such as disk drives, tape drives, printers, scanners, optical drives, and the like. These peripheral devices are attached to the computer system by means of a peripheral bus (e.g., cable).
One of the most widely used peripheral buses is the well known small computer systems interface (SCSI) bus, which is defined in conformity with well known SCSI protocols (e.g., SCSI-1, SCSI-2, SCSI-3, etc.), which are incorporated herein by reference. The SCSI protocols are designed to provide an efficient peer-to-peer I/O interface between a host computer and its peripheral devices in a computer system.
FIG. 1 shows a block diagram of a conventional computer system 100 including a host computer 102, a plurality of SCSI devices 106, and a SCSI bus 108. The host computer 102 includes a SCSI host adapter 104 for communicating with the SCSI devices 106. The host adapter 104 in the computer system 100 controls communication between the host computer 102 and the SCSI devices 106. For example, the host adapter 104 provides a physical connection between the host computer 102 and the SCSI bus 108. In addition, it is configured to receive data, address, and control signals from the host computer 102 and convert the signals into corresponding SCSI compatible data, address, and control signals. Conversely, the SCSI host adapter 104 is also configured to receive SCSI compatible data, address, and control signals from the SCSI devices 106 through the SCSI bus 108 and convert them into corresponding host-bus compatible data, addressing, and control signals. The SCSI host adapter 104 is well known in the art and may be implemented, for example, by using AIC-7890A(trademark) packaged semiconductor device, which is available from Adaptec Inc., of Milpitas, Calif.
Under the conventional SCSI specifications, the SCSI bus 108 may connect up to 16 SCSI devices including the host adapter 104 depending on the type of SCSI bus implemented. The SCSI devices 106 may be peripheral devices such as disk drives, tape drives, printers, scanners, optical drives, or any other devices that meet the SCSI specification. The SCSI bus 108 is typically implemented as a cable having a set of parallel wires. For example, the SCSI-1 cable has 50 wires. Of these 50 wires, eight wires are for data, one wire is for parity, nine wires are for control, 25 wires are for ground, and the remaining wires are for power or are reserved for future use. The eight data wires are used to carry eight bits of data in parallel. In general, conventional SCSI bus cables include either 8 or 16 data wires for carrying 8 or 16 bits, respectively, of data in parallel. The data wires in the bus thus define a datapath for communicating bits equal to the number of data wires in the bus.
A traditional SCSI bus may accommodate a plurality of SCSI devices up to a maximum number equal to the number of data bits in the SCSI bus. In practice, the width of the SCSI datapath is typically 8 or 16 bits corresponding to the number of data wires in the SCSI bus. This means the maximum number of SCSI devices, including a host adapter, that can be attached to a SCSI bus is limited to 8 or 16.
Conventional SCSI buses, however, are generally capable of transmitting signals reliably for a specified cable length only. For example, SCSI bus cables conforming to SCSI specifications are typically limited to a maximum length such as 3, 6, 12, or 25 meters, and the like. In modern computer systems such as servers that need to communicate with numerous SCSI devices, some SCSI peripheral devices may be located more than the specified cable length away from a host computer.
In such instances, an expander, which is essentially a repeater, is typically used to add another SCSI bus, which is then used to couple additional SCSI devices. FIG. 2 illustrates a conventional computer system 200 that includes an expander 214 for connecting two SCSI buses 208 and 210. In the computer system 200, a host computer 202 is coupled to the SCSI bus 208 via a SCSI host adapter 204. One or more SCSI devices 206 are coupled to the SCSI bus 208 while one or more SCSI devices 212 are coupled to the SCSI bus 210. The expander 214 is coupled between the SCSI buses 208 and 210 to regenerate signals received on either SCSI bus 208 or 210 for transmission to the other SCSI bus. In this configuration, the expander 214 functions to extend the length of the overall SCSI bus so that additional SCSI devices 212 or expanders can be attached to the SCSI bus 210. The SCSI devices 212 and SCSI bus 210 are collectively referred to as a segment. Similarly, the host adapter 204, SCSI devices 206, and SCSI bus 208 collectively define another segment.
Conventional expanders, however, are typically transparent devices without SCSI IDs of their own. This means that the expanders are not addressable and are thus invisible to SCSI protocol. Using such transparent expanders without dedicated SCSI IDs in an I/O subsystem presents several drawbacks. For example, individual segments of the I/O subsystem often need to be modified to isolate faulty cables, connections, drivers, and receivers. In addition, it is often desirable to communicate with individual expanders to determine optimum speed at which the expanders can communicate during domain validation.
Because conventional expanders are not addressable, these modifications and domain validation processes may not be performed automatically without a system administrator. One obvious solution would be to implement expanders like SCSI devices by adding SCSI controllers and assigning SCSI IDs used for SCSI devices. This solution, however, would reduce the number of addressable SCSI devices that can be attached to a SCSI I/O subsystem. Further, assigning SCSI addresses to expanders will typically require system administrators to keep track of SCSI IDs of all individual expanders and manually set the jumpers for the expander IDs. In a complex I/O subsystem with substantial number of SCSI devices and expanders, assigning SCSI IDs to expanders by manually setting the jumpers may be complicated and labor intensive.
In view of the foregoing, what is needed is a method for automatically addressing SCSI expanders without using valuable conventional SCSI IDs.
The present invention fills these needs by providing methods for automatically assigning addresses to intelligent expanders in an I/O subsystem. It should be appreciated that the present invention can be implemented in numerous ways, including as a process, an apparatus, a system, a device, a method, or a computer readable medium. Several inventive embodiments of the present invention are described below.
In one embodiment, the present invention provides a method for automatically assigning addresses to expanders in a computer I/O subsystem that is coupled to one or more host computers. The computer I/O subsystem includes one or more peripheral buses, a set of peripheral devices, and a set of expanders with each expander being arranged to couple a pair of peripheral buses. The peripheral devices are coupled to the peripheral buses. In this configuration, a host computer selects a peripheral device as a target device and writes an address data pattern to the selected target device. The host computer then selects the target device and reads the address data pattern from the target device. Unique addresses are then assigned to one or more expanders coupling the host computer and the target device starting from the address data pattern, preferably by incrementing the address data pattern.
In another embodiment, the present invention provides a method for automatically assigning addresses to expanders in a computer I/O subsystem that is coupled to one or more host computers. The computer I/O subsystem includes one or more peripheral buses, a set of peripheral devices, and a set of expanders with each expander being arranged to couple a pair of peripheral buses. The peripheral devices are coupled to the peripheral buses. In this method, the host computer selects a peripheral device as a target device and sends a write buffer command to the target device to write an address data pattern. The host computer then selects the target device and sends a read buffer command to the target device to read the address data pattern from the target device. Unique addresses are assigned to one or more expanders coupling the host computer and the target device beginning from the address data pattern. Specifically, an expander is selected among the one or more expanders coupling the host computer and the target device. The address data pattern is assigned to the selected expander as a unique address. Then, the address data pattern is incremented to generate a next address data pattern for assignment to a next expander.
In yet another embodiment, the present invention discloses a method for automatically assigning addresses to expanders in a computer I/O subsystem that is coupled to one or more host computers. The computer I/O subsystem includes one or more peripheral buses, a set of peripheral devices, and a set of expanders with each peripheral bus having an N-bit data bus. Each expander is arranged to couple a pair of peripheral buses. The peripheral devices are coupled to the peripheral buses. The method includes: (a) defining an expander address space for address data patterns by partitioning the N-bit data bus into a pair of fields that includes an expander ID field and an expander signature field, wherein each address data pattern includes a common expander signature in the expander signature field and an expander ID in the expander ID field and wherein more than two bits are asserted in each of the address data patterns; (b) issuing, by a host computer, a broadcast command to the expanders in the I/O subsystem, the broadcast command indicating an automatic addressing mode to automatically assign addresses to the expanders; (c) selecting, by the host computer, a peripheral device as a target device and sending a write buffer command to the target device to write an address data pattern; (d) selecting, by the host computer, the target device and sending a read buffer command to the target device to read the address data pattern from the target device; and (e) assigning unique addresses to one or more expanders coupling the host computer and the target device, wherein the unique addresses are assigned to the one or more expanders starting from the address data pattern.
Advantageously, the methods of the present invention allow automatic assignment of addresses to expanders without using conventional one-bit SCSI device IDs. To automatically assign addresses to expanders, a host computer sequentially traverses each of the peripheral devices by writing and reading an address data pattern, which is preferably configured to have more than two bits asserted. By sequentially writing and reading the address data pattern to a target peripheral device, expanders in the path between the host computer and the target peripheral device are assigned addresses starting from the address data pattern. As an address data pattern is assigned to an expander, the address data pattern is modified, for example by incrementing, for assignment to a next expander. In this manner, when all peripheral devices have been traversed, all addressable expanders in the I/O subsystem are automatically assigned unique addresses. Other aspects and advantages of the invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating by way of example the principles of the invention.